package audit

import (
	"context"

	"github.com/infraboard/mcube/http/request"
)

const (
	AppName = "audit"
)

type Service interface {
	// 保存日志
	SaveAuditLog(context.Context, *AuditLog) (*AuditLog, error)
	// 查询日志
	QueryAuditLog(context.Context, *QueryAuditLogRequest) (*AuditLogSet, error)
}

func NewQueryAuditLogRequest() *QueryAuditLogRequest {
	return &QueryAuditLogRequest{
		// Audit:       NewAudit(),
		// PageRequest: request.NewDefaultPageRequest(),
	}
}

type QueryAuditLogRequest struct {
	StartTime           int64 `json:"start_time,omitempty" description:"起始时间" default:"0"`
	EndTime             int64 `json:"end_time,omitempty" description:"结束时间" default:"now"`
	Audit               `json:",inline"`
	request.PageRequest `json:",inline"`
}
